//
//  ClubVVC.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/12.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//
//点击不同的button是切换数据源

#import "ClubVVC.h"
#import "CommonMacro.h"

#import "BackCircleView.h"
#import "AddClubTableView.h"

@interface ClubVVC ()<changeDifferentCircleAndBackDelegate>
{
    BackCircleView *backCircleView;
    AddClubTableView *addClubTalbeView;
}
@property (nonatomic,strong)NSMutableArray *contentArr;
@property (nonatomic,strong)NSArray *faulseArrary;
@end

@implementation ClubVVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = UIColorWithRGBA(248, 109, 148, 1);
    //添加子控件
    [self initUIView];
}

#pragma mark 数据源
- (void)initData
{

}

#pragma mark 添加tableview
- (void)initUIView
{
    //1.添加 返回按钮 热门圈子 推荐圈子
    backCircleView = [[BackCircleView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT*0.17)];
    backCircleView.changeAndBackDelegate = self;
    [self.view addSubview:backCircleView];
    
    //2.添加表格
    addClubTalbeView = [[AddClubTableView alloc] initWithFrame:CGRectMake(20, backCircleView.frame.size.height, SCREEN_WIDTH-40, SCREEN_HEIGHT*0.8)];
    [self.view addSubview:addClubTalbeView];
    
}

#pragma mark changeDifferentCircleAndBackDelegate
- (void)changeDifferentCircleAndBack:(UIButton *)button
{
    if (backCircleView.lastButton!=button) {
        backCircleView.lastButton.selected = NO;
    }
     backCircleView.lastButton = button;
    button.selected = YES;
   
    if (button.tag==1000)
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
    else if (button.tag==1001)
    {
        NSLog(@"点击了热门圈子");
    }
    else
    {
    NSLog(@"点击了推荐圈子");
    }

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
